home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 January: Mac OS SDK / Dev.CD Jan 96 SDK / Dev.CD Jan 96 SDK1.toast / Development Kits (Disc 1) / AppleScript / Development Tools / Interfaces / AppleScript 1.1 Interfaces / CIncludes / TSMTE.h < prev   
Encoding:
C/C++ Source or Header  |  1995-01-27  |  5.0 KB  |  170 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        TSMTE.h
  3.  
  4.     Contains:    Definitions for TSMTE
  5.  
  6.     Written by:    Kida Yasuo, Hara Keisuke
  7.  
  8.     Copyright:    ©1991, 1992, 1994 Apple Operations and Technologies Japan, Inc.
  9.                 All rights reserved.
  10. */
  11.  
  12. #ifndef    __TSMTE__
  13. #define    __TSMTE__
  14.  
  15. #ifndef __TEXTEDIT__
  16. #include <TextEdit.h>
  17. /*    #include <Quickdraw.h>                                        */
  18. /*        #include <Types.h>                                        */
  19. /*            #include <ConditionalMacros.h>                        */
  20. /*            #include <MixedMode.h>                                */
  21. /*                #include <Traps.h>                                */
  22. /*        #include <QuickdrawText.h>                                */
  23. /*            #include <IntlResources.h>                            */
  24. #endif
  25.  
  26. #ifndef __DIALOGS__
  27. #include <Dialogs.h>
  28. /*    #include <Windows.h>                                        */
  29. /*        #include <Events.h>                                        */
  30. /*            #include <OSUtils.h>                                */
  31. /*        #include <Controls.h>                                    */
  32. /*            #include <Menus.h>                                    */
  33. #endif
  34.  
  35. #ifndef __TEXTSERVICES__
  36. #include <TextServices.h>
  37. /*    #include <AppleEvents.h>                                    */
  38. /*        #include <Memory.h>                                        */
  39. /*        #include <EPPC.h>                                        */
  40. /*            #include <PPCToolBox.h>                                */
  41. /*                #include <AppleTalk.h>                            */
  42. /*            #include <Processes.h>                                */
  43. /*                #include <Files.h>                                */
  44. /*                    #include <SegLoad.h>                        */
  45. /*        #include <Notification.h>                                */
  46. /*    #include <Errors.h>                                            */
  47. /*    #include <Components.h>                                        */
  48. #endif
  49.  
  50.  
  51. // Signature, interface types.
  52.  
  53. enum  {
  54.     kTSMTESignature                = 'tmTE',
  55.     kTSMTEInterfaceType            = kTSMTESignature,
  56.     kTSMTEDialog                = 'tmDI'
  57. };
  58.  
  59.  
  60. // Gestalt
  61.  
  62. enum  {
  63.     gestaltTSMTEAttr            = kTSMTESignature,
  64.     gestaltTSMTEPresent            = 0,
  65.     gestaltTSMTE                = gestaltTSMTEPresent,
  66.     gestaltTSMTEVersion            = 'tmTV',
  67.     gestaltTSMTE1                = 0x100
  68. };
  69.  
  70. enum {
  71.     kTSMTEAutoScroll    = 1                //    auto scroll on
  72. };
  73.  
  74.  
  75. // Callback procedure definitions
  76.  
  77. typedef pascal void (*TSMTEPreUpdateProcPtr)(TEHandle textH, long refCon);
  78.  
  79. enum {
  80.     uppTSMTEPreUpdateProcInfo = kPascalStackBased
  81.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(TEHandle)))
  82.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  83. };
  84.  
  85. #if USESROUTINEDESCRIPTORS
  86. typedef UniversalProcPtr TSMTEPreUpdateUPP;
  87.  
  88. #define CallTSMTEPreUpdateProc(userRoutine, textH, refCon)        \
  89.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTSMTEPreUpdateProcInfo, (textH), (refCon))
  90. #define NewTSMTEPreUpdateProc(userRoutine)        \
  91.         (TSMTEPreUpdateUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTSMTEPreUpdateProcInfo, GetCurrentISA())
  92. #else
  93. typedef TSMTEPreUpdateProcPtr TSMTEPreUpdateUPP;
  94.  
  95. #define CallTSMTEPreUpdateProc(userRoutine, textH, refCon)        \
  96.         (*(userRoutine))((textH), (refCon))
  97. #define NewTSMTEPreUpdateProc(userRoutine)        \
  98.         (TSMTEPreUpdateUPP)(userRoutine)
  99. #endif
  100.  
  101. typedef pascal void (*TSMTEPostUpdateProcPtr)(TEHandle textH, long fixLen, long inputAreaStart, long inputAreaEnd, long pinStart, long pinEnd, long refCon);
  102.  
  103. enum {
  104.     uppTSMTEPostUpdateProcInfo = kPascalStackBased
  105.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(TEHandle)))
  106.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  107.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long)))
  108.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
  109.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(long)))
  110.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(long)))
  111.          | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(long)))
  112. };
  113.  
  114. #if USESROUTINEDESCRIPTORS
  115. typedef UniversalProcPtr TSMTEPostUpdateUPP;
  116.  
  117. #define CallTSMTEPostUpdateProc(userRoutine, textH, fixLen, inputAreaStart, inputAreaEnd, pinStart, pinEnd, refCon)        \
  118.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTSMTEPostUpdateProcInfo, (textH), (fixLen), (inputAreaStart), (inputAreaEnd), (pinStart), (pinEnd), (refCon))
  119. #define NewTSMTEPostUpdateProc(userRoutine)        \
  120.         (TSMTEPostUpdateUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTSMTEPostUpdateProcInfo, GetCurrentISA())
  121. #else
  122. typedef TSMTEPostUpdateProcPtr TSMTEPostUpdateUPP;
  123.  
  124. #define CallTSMTEPostUpdateProc(userRoutine, textH, fixLen, inputAreaStart, inputAreaEnd, pinStart, pinEnd, refCon)        \
  125.         (*(userRoutine))((textH), (fixLen), (inputAreaStart), (inputAreaEnd), (pinStart), (pinEnd), (refCon))
  126. #define NewTSMTEPostUpdateProc(userRoutine)        \
  127.         (TSMTEPostUpdateUPP)(userRoutine)
  128. #endif
  129.  
  130.  
  131.  
  132. // TSMTERec
  133.  
  134. #if defined(powerc) || defined (__powerc)
  135. #pragma options align=mac68k
  136. #endif
  137. struct TSMTERec {
  138.     TEHandle                textH;            // TEHandle
  139.     TSMTEPreUpdateUPP        preUpdateProc;    // if not nil, this is called before updating text
  140.     TSMTEPostUpdateUPP        postUpdateProc;    // if not nil, this is called after updating text
  141.     long                    updateFlag;        // flags described above
  142.     long                    refCon;            // reference constant used by application
  143. };
  144. #if defined(powerc) || defined(__powerc)
  145. #pragma options align=reset
  146. #endif
  147.  
  148. typedef struct TSMTERec TSMTERec, *TSMTERecPtr, **TSMTERecHandle;
  149.  
  150.  
  151. // TSMDalogRecord
  152.  
  153. #if defined(powerc) || defined (__powerc)
  154. #pragma options align=mac68k
  155. #endif
  156. struct TSMDialogRecord {
  157.     DialogRecord        fDialog;        // Dialog Record
  158.     TSMDocumentID        fDocID;            // TSMDocument ID
  159.     TSMTERecHandle        fTsmteRecH;        // Handle to the TSMTERec
  160.     long                fTSMTERsvd[3];    // •Internally used•
  161. };
  162. #if defined(powerc) || defined(__powerc)
  163. #pragma options align=reset
  164. #endif
  165.  
  166. typedef struct TSMDialogRecord TSMDialogRecord, *TSMDialogPeek;
  167.  
  168.  
  169. #endif    /*    #define    __TSMTE__    */
  170.